﻿// SyntheticDataGenerator.ParameterSets.PatternParameters
//
// (c) 2011 Arthur Pitman
//
// Part of Market-Basket Synthetic Data Generator
// A C# adaptation of the IBM Quest Market-Basket Synthetic Data Generator
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// (Version 2) as published by the Free Software Foundation.
// 
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// 
// You should have received a copy of the GNU General Public
// License (Version 2) along with this program; if not, write to 
// the Free Software Foundation, Inc., 
// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
// or see <http://www.gnu.org/licenses/>.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace SyntheticDataGenerator.ParameterSets
{
	/// <summary>
	/// Pattern parameters
	/// </summary>
	public class PatternParameters
	{
		/// <summary>
		/// Number of patterns
		/// </summary>
		public int PatternCount;

		/// <summary>
		/// Average pattern length
		/// </summary>
		public double AverageLength;

		/// <summary>
		/// Correlation between consecutive patterns
		/// </summary>
		public double Correlation;

		/// <summary>
		/// Average confidence in a rule
		/// </summary>
		public double Confidence;

		/// <summary>
		/// Variation in the confidence 
		/// </summary>
		public double ConfidenceVariance;

		/// <summary>
		/// Initializes a new <see cref="PatternParameters"/> instance with default values
		/// </summary>
		public PatternParameters()
		{
			PatternCount = 10000;
			AverageLength = 4.0;
			Correlation = 0.25;
			Confidence = 0.75;
			ConfidenceVariance = 0.1;
	  
		}

		/// <summary>
		/// Writes parameters to a <see cref="TextWriter"/>
		/// </summary>
		/// <param name="writer"></param>
		public void Write(TextWriter writer)
		{
			writer.WriteLine("PatternCount={0}, AveragePatternLength={1}, Correlation={2}, AverageConfidence={3}, ConfidenceVariance={4}",
				PatternCount, AverageLength, Correlation, Confidence, ConfidenceVariance);
		}
	}
}
